#region Using directives

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Diagnostics;

#endregion

//============================================================================
//  File:    AboutForm.cs
//
//  Summary: Implements the About Form of SQL2005 Service Manager
//
//----------------------------------------------------------------------------
//
// Copyright (C) sqldbatips.com.  All rights reserved.
//
//  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//============================================================================

namespace SQL2005_Service_Manager
{
	//displays version and contact information for program
	public partial class AboutForm : Form
	{

		#region Variables

		private String productversion;		//used to store the current product version
		const String MAILTO = @"mailto:smbugs@sqldbatips.com?Subject=Support/Bug Report for SQL2005 Service Manager ";
		const String WEBSITE = @"http://www.sqldbatips.com";

		#endregion

		#region Constructor

		public AboutForm()
		{
			InitializeComponent();
		}

		#endregion

		#region Events

		//form load event
		private void AboutForm_Load(object sender, EventArgs e)
		{
			//version
			Assembly a = Assembly.GetExecutingAssembly();
			AssemblyName name = a.GetName();
			productversion = name.Version.ToString();
			lblversion.Text += productversion;
			lblclrversion.Text += a.ImageRuntimeVersion.ToString();
			a = null;
		}

		//close form
		private void btnClose_Click(object sender, EventArgs e)
		{
			this.Close();
		}

		// click on the support link
		private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			try
			{
				String strURL = MAILTO + productversion;
				Process.Start(strURL);
			}
			catch (Exception ex)
			{
				MainForm.ShowError(ex);
			}
		}

		// click on image
		private void pictureBox1_Click(object sender, EventArgs e)
		{
			try
			{
				Process.Start(WEBSITE);
			}
			catch (Exception ex)
			{
				MainForm.ShowError(ex);
			}
		}

		#endregion

	}
}